﻿#ifndef VIDEOCONTROLLER_H
#define VIDEOCONTROLLER_H

#include <QObject>
#include <QMap>

#include "config/jsonconfig.h"

class VideoController : public QObject
{
    Q_OBJECT
public:
    explicit VideoController(JsonConfig* jsonConfig, QObject *parent = nullptr);

public:
    // 设置当前的伺服机构列表
    void setServoMachineList(const QStringList& servoMachineList);
    // 得到播放时刻和持续时长
    bool getVideoPlayback(const QString& video, VideoPlayback& playback);

private:
    void init();


private:
    // JSON配置文件
    JsonConfig* m_jsonConfig;

    // 伺服机构列表
    QStringList m_servoMachineList;

    // 1, 2, 3, 4个伺服机构
    QMap<QString, VideoPlayback> m_onePlaybackMap;
    QMap<QString, VideoPlayback> m_twoPlaybackMap;
    QMap<QString, VideoPlayback> m_threePlaybackMap;
    QMap<QString, VideoPlayback> m_fourPlaybackMap;

};

#endif // VIDEOCONTROLLER_H
